<?php
//dezend by http://www.yunlu99.com/ QQ:270656184
defined('BASEPATH') || exit('No direct script access allowed');
$this->load->helper('url');
?><link rel="stylesheet" type="text/css" href="/static/css/upload.css">
<form id="ff" method="post" style="margin:10px 0px 0px 10px;display:block;">
	<input type="hidden" name="id" value="<?php echo $id;?>">
	<table style="font-size:12px;" cellspacing="10">
		<tr>
			<td>网站名称</td>
			<td><input type="text" class="easyui-validatebox" name="name" value="<?php echo $name;?>" required="true"> 英文：<input type="text" class="easyui-validatebox" name="en_name" value="<?php echo $en_name;?>" required="true"></td>
		</tr>
		<tr>
			<td>网站标题</td>
			<td><input type="text" class="easyui-validatebox" name="title" value="<?php echo $title;?>" required="true"> 英文：<input type="text" class="easyui-validatebox" name="en_title" value="<?php echo $en_title;?>" required="true"></td>
		</tr>
		<tr>
			<td>网站描述</td>
			<td><input class="easyui-textbox" style="width:300px;height:100px;" data-options="multiline:true" name="description" value="<?php echo $description;?>"> 英文：<input style="width:300px;height:100px;" class="easyui-textbox" data-options="multiline:true" name="en_description" value="<?php echo $en_description;?>"></td>
		</tr>
		<tr>
			<td>网站关键字</td>
			<td><input type="text" class="easyui-validatebox" name="keyword" value="<?php echo $keyword;?>" required="true"> 英文：<input type="text" class="easyui-validatebox" name="en_keyword" value="<?php echo $en_keyword;?>" required="true"></td>
		</tr>
		<tr>
			<td>网站简介</td>
			<td><input style="width:300px;height:100px;" class="easyui-textbox" data-options="multiline:true" name="intro" value="<?php echo $intro;?>"> 英文：<input style="width:300px;height:100px;" class="easyui-textbox" data-options="multiline:true" name="en_intro" value="<?php echo $en_intro;?>"></td>
		</tr>
		<tr>
			<td>版权信息</td>
			<td><input type="text" class="easyui-validatebox" name="copyright" value="<?php echo $copyright;?>" required="true"></td>
		</tr>
		<tr>
			<td>备案信息</td>
			<td><input type="text" class="easyui-validatebox" name="icp" value="<?php echo $icp;?>" required="true"></td>
		</tr>
		<tr>
			<td>公司地址</td>
			<td><input type="text" class="easyui-validatebox" name="address" value="<?php echo $address;?>"> 英文：<input type="text" class="easyui-validatebox" name="en_address" value="<?php echo $en_address;?>"></td>
		</tr>
		<tr>
			<td>短信平台帐号</td>
			<td><input type="text" class="easyui-validatebox" name="mobile_username" value="<?php echo $mobile_username;?>"></td>
		</tr>
		<tr>
			<td>短信平台密码</td>
			<td><input type="text" class="easyui-validatebox" name="mobile_password" value="<?php echo $mobile_password;?>"></td>
		</tr>
		<tr>
			<td>短信平台apikey</td>
			<td><input type="text" class="easyui-validatebox" name="mobile_apikey" value="<?php echo $mobile_apikey;?>"></td>
		</tr>
		<tr>
			<td>邮箱平台帐号</td>
			<td><input type="text" class="easyui-validatebox" name="email_username" value="<?php echo $email_username;?>"></td>
		</tr>
		<tr>
			<td>邮箱平台密码</td>
			<td><input type="text" class="easyui-validatebox" name="email_password" value="<?php echo $email_password;?>"></td>
		</tr>
		<tr>
			<td>手机号码</td>
			<td><input type="text" class="easyui-validatebox" name="phone" value="<?php echo $phone;?>"></td>
		</tr>
		<tr>
			<td>座机号码</td>
			<td><input type="text" class="easyui-validatebox" name="tel" value="<?php echo $tel;?>"></td>
		</tr>
		<tr>
			<td>邮箱地址</td>
			<td><input type="text" class="easyui-validatebox" name="email" value="<?php echo $email;?>"></td>
		</tr>
		<tr>
			<td>客服QQ</td>
			<td><input type="text" class="easyui-validatebox" name="qq" value="<?php echo $qq;?>"></td>
		</tr>
		<tr>
			<td>客服QQ群</td>
			<td><input type="text" class="easyui-validatebox" name="qun" value="<?php echo $qun;?>"></td>
		</tr>
		<tr>
			<td>威信二维码图片</td>
			<td>
				<div id="weixin_view" class="upload_view"><img src="/upload/system/<?php echo $weixin;?>"></div>
				<input type="file" id="weixin_upload">
				<input type="hidden" name="weixin" id="weixin" value="<?php echo $weixin;?>">
			</td>
		</tr>
		<tr>
			<td>网站LOGO</td>
			<td>
				<div id="logo_view" class="upload_view"><img src="/upload/system/<?php echo $logo;?>"></div>
				<input type="file" id="logo_upload">
				<input type="hidden" name="logo" id="logo" value="<?php echo $logo;?>">
			</td>
		</tr>
		<tr>
			<td></td>
			<td>
			<button type="submit" class="easyui-linkbutton" iconCls="icon-ok">提交</button>
			</td>
		</tr>
	</table>
</form>

<script language="javascript">
$(function(){
	$('#ff').form({
		url:'<?php echo site_url('system/update');?>',
		onSubmit:function(){
			return $(this).form('validate');
		},
		success:function(data){
			data = eval('('+data+')');
			$.messager.alert('信息提示',data.msg,'info');
			if(data.error == 0){
				$('#win').window('close');
				$('#tt').datagrid('reload');
			}
		}
	});
	
	$("#logo_upload").uploadify({ 
        'swf'             : '/uploadify/uploadify.swf', 
        'uploader'        : '<?php echo site_url('system/upload');?>', 
		'buttonClass'     : 'uploadbtn',
		'buttonText'	  : '上传LOGO图',
		'height'          : 26,
		'width'    : 160, 
		'multi'    : false, 
		'onUploadProgress' : function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) { 
            $('#progress').html('已上传'+totalBytesUploaded + ' 字节。共 ' + totalBytesTotal + ' 字节.'); 
        },
        'onUploadSuccess' : function(file, data, response) {
			data = eval('('+data+')');
			if(response && data.error == 0){
				$('#logo_view').html('<img src="/upload/system/'+data.file_name+'">');
				$('#logo').val(data.file_name);
			}else{
				$.message.alert('Info','上传失败','info');
			}
        } 
    });

	$("#weixin_upload").uploadify({ 
        'swf'             : '/uploadify/uploadify.swf', 
        'uploader'        : '<?php echo site_url('system/upload');?>', 
		'buttonClass'     : 'uploadbtn',
		'buttonText'	  : '上传威信二维码图',
		'height'          : 26,
		'width'    : 160, 
		'multi'    : false, 
		'onUploadProgress' : function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) { 
            $('#progress').html('已上传'+totalBytesUploaded + ' 字节。共 ' + totalBytesTotal + ' 字节.'); 
        },
        'onUploadSuccess' : function(file, data, response) {
			data = eval('('+data+')');
			if(response && data.error == 0){
				$('#weixin_view').html('<img src="/upload/system/'+data.file_name+'">');
				$('#weixin').val(data.file_name);
			}else{
				$.message.alert('Info','上传失败','info');
			}
        } 
    });
});
</script>